package com.ruoyi.inducePest.service.inducePest;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.ruoyi.inducePest.domain.inducePest.InducePestBroadcastInfo;
import com.ruoyi.inducePest.domain.inducePest.InducePestImgInfo;
import com.ruoyi.inducePest.domain.inducePest.NewInducePestBroadcastInfo;
import com.ruoyi.inducePest.domain.inducePest.NewInducePestBroadcastInfoForSingleDevice;

import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author LiSuxuan
 * @date 2021年08月31日 15:32
 */
public interface InducePestDataAnalysisService {


    /**
     *  按天查找虫子列表
     * @return 列表
     */
    public List<String> selectInsectByDay(Date beginTime,Date endTime,String imgPest,Integer userId);

    /**
     * 按天查询tag的corner
     *
     * @return 列表
     */
    public List<String> selectCornerByDay(Date beginTime,Date endTime,String imgPest,Integer userId);

    /**
     * 按天查询所有信息
     *
     * @return 列表
     */
    public List<InducePestImgInfo> selectAllInfoByDay(Date beginTime, Date endTime,String imgPest,Integer userId);

    /**
     * 按天查询所有信息
     *
     * @return 列表
     */
    public List<InducePestImgInfo> selectAllInfoByDayAndDevice(Date beginTime, Date endTime,Integer deviceId,String imgPest,Integer userId);


    /**
     *  查询某一天之前的最后一条tag
     * @return 列表
     */
    public List<String> selectLastInsectByDay(Date beginTime,String imgPest,Integer userId);

    /**
     *  查询某一天之前的最后一条Info
     * @return 列表
     */
    public InducePestImgInfo selectLastInsectInfoByDay(Date beginTime,  Integer deviceId);

    /**
     * 查询某一天之前的最后一条Corner
     *
     * @return 列表
     */
    public List<String> selectLastCornerByDay(Date beginTime,String imgPest,Integer userId);

    /**
     *  根据设备编号查询某一天之前的最后一条tag
     * @return 列表
     */
    public List<String> selectLastInsectByDayAndDeviceId(Date beginTime,Integer deviceId,String imgPest,Integer userId);

    /**
     * 根据设备编号查询某一天之前的最后一条Corner
     *
     * @return 列表
     */
    public List<String> selectLastCornerByDayAndDeviceId(Date beginTime,Integer deviceId,String imgPest,Integer userId);

    /**
     *  按天和设备查找虫子列表
     * @return 列表
     */
    public List<String> selectInsectByDayAndDeviceId(Date beginTime,Date endTime,Integer deviceId,String imgPest,Integer userId);

    /**
     *  按天和设备查找corner
     * @return 列表
     */
    public List<String> selectCornerByDayAndDeviceId(Date beginTime,Date endTime,Integer deviceId,String imgPest,Integer userId);

    /**
     * 按天查找设备
     *

     * @return 列表
     */
    public List<Integer> selectDeviceIdByDay(Date beginTime,Date endTime,String imgPest,Integer userId);


    /**
     *  按天查找虫子图片总数

     * @return 列表
     */
    public Integer selectInsectImgNum(Date beginTime,Date endTime,String imgPest,Integer userId,Integer deviceId);

    /**
     * 删除数据
     *
     */
    public Integer deleteInducePestImgInfo(int id);

    List<NewInducePestBroadcastInfo> diffTimeByDeviceIds(List<String> dates, String deviceIdsString, String imgPest) throws ParseException, JsonProcessingException;

    Map<String, Integer> totalByDevice(List<String> dates, String deviceIdsString, String imgPest) throws ParseException, JsonProcessingException;

    List<NewInducePestBroadcastInfoForSingleDevice> diffTimeByDeviceIdsForSingle(List<String> dates, String deviceIdsString, String imgPest) throws JsonProcessingException, ParseException;

    List<NewInducePestBroadcastInfo> diffTimeByDeviceIdForPest(List<String> dates, Integer deviceId, String imgPest) throws JsonProcessingException, ParseException;
}
